package com.wide.core.shared.json;

/**
 * A core implementation of the GWT JSONBoolean that can be used on both the client and the server.
 * @author Barry
 *
 */
public class JsonBoolean implements JsonValue {
	private boolean value = false; 
	
	public JsonBoolean() {
		super();
	}

	public JsonBoolean(boolean value) {
		super();
		this.value = value;
	}

	@Override
	public boolean isBoolean() {
		return true;
	}

	@Override
	public boolean isString() {
		return false;
	}

	@Override
	public boolean isNumber() {
		return false;
	}

	@Override
	public boolean isObject() {
		return false;
	}

	@Override
	public boolean isArray() {
		return false;
	}

	@Override
	public boolean isNull() {
		return false;
	}
	
	public boolean getValue() {
		return value;
	}
	
	public void setValue(boolean value) {
		this.value = value;
	}

	public String toString() {
		return Boolean.toString(value);
	}
}
